package com.comtop.springboot.templet.modules.sys.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.comtop.springboot.templet.modules.sys.entity.SysMenuEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 菜单管理
 * 
 * @author wangjiafang
 * @version 1.0
 * @since 2016年9月18日 上午9:33:01
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenuEntity> {
	
	/**
	 * 根据父菜单，查询子菜单
	 * @param parentId 父菜单ID
	 */
	@Select("select * from sys_menu where parent_id = #{parentId} order by order_num asc")
	List<SysMenuEntity> queryParentIdMenuList(Long parentId);
	
	/**
	 * 获取不包含按钮的菜单列表
	 */
	@Select("select * from sys_menu where type not in (2) order by order_num asc")
	List<SysMenuEntity> queryNotButtonMenuList();

	/**
	 * 查询所有菜单
	 * @param map
	 * @return
	 */
	List<SysMenuEntity> queryAllMenuList(Map<String, Object> map);

	/**
	 * 删除菜单和角色菜单关第表数据
	 * @param id 菜单id
	 * @return
	 */
	int deleteMenuBatch(Object[] id);
	

}
